package com.xz.realdemo2.util;

import com.xz.realdemo2.model.OfficalDocTemplate;

import java.util.Hashtable;
import java.util.Map;

/**
 * @author 张志航     
 * @version V1.0.0
 * @projectName design_mode
 * @title     TemplateManager   
 * @package    com.xz.realdemo2.util  
 * @date   2019/12/2 16:11  
 * @explain
 */
// 公文管理器
public class TemplateManager {

    Map<String,OfficalDocTemplate> templateMap = new Hashtable<>();

    public TemplateManager() {
        OfficalDocTemplate docTemplate = new OfficalDocTemplate();
        docTemplate.setName("默认公文");
        docTemplate.setContent("默认内容");
        templateMap.put("default",docTemplate);
    }

    public void add(String key,OfficalDocTemplate docTemplate){
        templateMap.put(key,docTemplate);
    }

    public OfficalDocTemplate get(String key){
        return templateMap.get(key);
    }

}
